﻿using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;

[HarmonyPatch(typeof(DamageWorker_AddInjury), "Apply")]
public static class DamageWorker_Bomb_Patch//友军伤害不做效
{
    //会不会是补丁的关系
    private static bool Prefix(DamageWorker_AddInjury __instance,ref DamageInfo dinfo, Thing thing)
    {
        var instigator = dinfo.Instigator;
        if (instigator != null && thing != null)
        {
            if (dinfo.Def.defName == "SZ_Bomb" || dinfo.Def.defName == "SZ_BombSub" || dinfo.Def.defName == "SZ_PoJunBomb" || dinfo.Def.defName == "SZ_PoJunBombSub" || dinfo.Def.defName == "SZ_Thunder" || dinfo.Def.defName == "SZ_PreThunder" || dinfo.Def.defName == "SZ_ThunderSec" || dinfo.Def.defName == "SZ_ThunderAlly"
             /*|| dinfo.Def.defName == "Flame"|| dinfo.Def.defName == "EMP"*/)//老板说屏蔽并且不会改记录：9月7号，关键字：你这个如果不会改我就改
            {


                if (instigator.Faction == thing.Faction)
                {
                    dinfo.SetAmount(0);
                }

            }
        }
        return true;
    }
}

